package com.athuahua.spzx.service.impl;

import com.athuahua.spzx.entity.SysRole;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.athuahua.spzx.entity.Brand;
import com.athuahua.spzx.service.BrandService;
import com.athuahua.spzx.mapper.BrandMapper;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
* @author huahua
* @description 针对表【brand(分类品牌)】的数据库操作Service实现
* @createDate 2024-07-29 15:04:56
*/
@Service
public class BrandServiceImpl extends ServiceImpl<BrandMapper, Brand>
    implements BrandService{

    @Resource
    private BrandMapper brandMapper;

    @Override
    public IPage<Brand> getBrandList(Integer page, Integer size) {
        IPage<Brand> iPage = new Page<>(
                page,
                size
        );

        LambdaQueryWrapper<Brand> queryWrapper = new LambdaQueryWrapper<>();
        //模糊查询
        queryWrapper.orderByDesc(Brand::getUpdateTime);

        return brandMapper.selectPage(iPage, queryWrapper);
    }
}




